<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        div {
            width: 500px;
            height: 500px;
            border: 1px solid #000;
            margin: 100px auto;
            background: url(../第十一天案例/media/dog.jpg)no-repeat;
            /* background-size: 500px 500px; */
            /* 背景图片尺寸 */
            /* background-size: cover; */
            /* 背景图片铺满,会导致一部分内容不显示 */
            background-size: contain;
            /* 背景图片哪边先铺满就停 */
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>